import { getHealthMail } from "../../utils/api";

const healthmall = {
  namespaced: true,
  state() {
    return {
      xstj: [],
      active: [],
      banner: [],
      nxhy: [],
      yhdp: [],
    };
  },
  mutations: {
    gethealthmallApi(state, payload) {
      state.active = payload.data.active;
      state.xstj = payload.data.xstj;
      state.banner = payload.data.banner;
      state.nxhy = payload.data.nxhy;
      state.yhdp = payload.data.yhdp;
    },
  },
  actions: {
    async gethealthmallApi({ commit }) {
      const res = await getHealthMail();
      commit("gethealthmallApi", { data: res.result[0] });
    },
  },
};

export default healthmall;
